package club;

import java.util.ArrayList;
import java.util.List;

public class Department {
    private String name;
    private List<Member> members;

    public Department(String name) {
        this.name = name;
        this.members = new ArrayList<>();
    }

    public String getName() {
        return name;
    }

    public void addMember(Member member) {
        members.add(member);
    }

    public Department removeMember(String studentId) {
        members.removeIf(member -> member.getStudentId().equals(studentId));
        return null;
    }

    public List<Member> getMembers() {
        return members;
    }

    public Member findMember(String studentId) {
        for (Member member : members) {
            if (member.getStudentId().equals(studentId)) {
                return member;
            }
        }
        return null;
    }
}
